Table Input
Functions for input management.
Functions
GetAnalogKeyValue(actionID) | Get the analog value of an action key. |
GetAnalogAxis(axis) | Get the analog value of an axis. |
GetMouseDisplayPosition() | Get the display position of the cursor in percent. |
IsKeyHit(actionID) | Check if an action key is being hit. |
IsKeyHeld(actionID, [delaySec]) | Check if an action key is being held. |
IsKeyPulsed(actionID, delaySec, [initialDelaySec]) | Check if an action key is being pulsed. |
IsKeyReleased(actionID, [maxDelaySec]) | Check if an action key is being released. |
PushKey(actionID) | Simulate an action key push. |
ClearKey(actionID) | Clear an action key. |
ClearAllKeys() | Clear all action keys. |
Vibrate(strength, [time]) | Vibrate the game controller if the function is available and the setting is on. |
Functions
- GetAnalogKeyValue(actionID)
-
Get the analog value of an action key.
Returns either 0 or 1 for digital key mappings (e.g. keyboard or gamepad buttons),
but may return arbitrary values in the range 0 to 1 for analog key mappings
(e.g. gamepad sticks, gamepad triggers, or mouse axes).
Parameters:
- actionID ActionID Action ID to query.
Returns:
-
float
Analog value in the range [0, 1].
- GetAnalogAxis(axis)
-
Get the analog value of an axis.
Parameters:
- axis AxisID Axis ID to fetch.
Returns:
-
Vec2
Analog axis with components in the range [-1, 1].
- GetMouseDisplayPosition()
-
Get the display position of the cursor in percent.
Returns:
-
Vec2
Cursor display position in percent.
- IsKeyHit(actionID)
-
Check if an action key is being hit.
Parameters:
- actionID ActionID Action ID to check.
- IsKeyHeld(actionID, [delaySec])
-
Check if an action key is being held.
Parameters:
- actionID ActionID Action ID to check.
- delaySec float Delay time in seconds before a hold can be registered. Default: 0.
- IsKeyPulsed(actionID, delaySec, [initialDelaySec])
-
Check if an action key is being pulsed.
Note that to avoid a stutter on the second pulse,
initialDelaySec
must be a multiple ofdelaySec
.Parameters:
- actionID ActionID Action ID to check.
- delaySec float Delay time in seconds between pulses.
- initialDelaySec float Initial delay time in seconds on the first pulse. Default: 0.
- IsKeyReleased(actionID, [maxDelaySec])
-
Check if an action key is being released.
Parameters:
- actionID ActionID Action ID to check.
- maxDelaySec float Max delay time in seconds between hit and release within which a release can be registered. Default: infinity.
- PushKey(actionID)
-
Simulate an action key push.
Parameters:
- actionID ActionID Action ID to push.
- ClearKey(actionID)
-
Clear an action key.
Parameters:
- actionID ActionID Action ID to clear.
- ClearAllKeys()
- Clear all action keys.
- Vibrate(strength, [time])
-
Vibrate the game controller if the function is available and the setting is on.
Parameters:
- strength float Vibration strength.
- time float Vibration time in seconds. Default: 0.3.